<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>面向对象</title>
</head>
<body>
<script>
    function Foo(){
    this.name = 1;
    }
    Foo.prototype.getName = function(){
        return this.name;
    };
    Foo.getName = function(){
        return 2;
    };
    
    function getName(){
        return 4;
    }
    alert(Foo.getName());
    alert(getName());
    alert(new Foo().getName());
    alert(Foo.getName());
    
</script>
</body>
</html>